package at.codebase.core;

import javax.servlet.http.HttpServletRequest;

import at.codebase.web.util.i18n.I18NLocale;

/**
 * Provides static access to application wide settings.
 * 
 * @author Daniel Marth <danielmarth@gmx.at>
 * @author Lukas Pfeifhofer <lukas.pfeifhofer@devlabs.pro>
 */
public class Settings {

	public static int XSRF_TOKEN_POOL_SIZE = 30;

	// Turn off caching (put on "false" for development mode)
	public static boolean TEMPLATE_FILE_CACHING = false;
	public static boolean I18N_FILE_CACHING = false;

	public static boolean ALLOW_DEMO_ACCOUNT_LOGIN = true;
	public static boolean ADD_SAMPLE_DATA_TO_APPLICATION = true;
	public static String[] ADMIN_ACCOUNT_MAILS = new String[] {
			"hardcodetest1@gmail.com", "hardcodetest2@gmail.com" };

	public static class Locales {

		public static I18NLocale[] all = new I18NLocale[] {
				new I18NLocale("deu"), new I18NLocale("eng") };

	}

	public static class Util {
		public final static int GoogleMapDefaultZoomLevel = 15;
	}

	private static String serverAddress = null;
	public static String getServerAddress() {
		return serverAddress;
	}
	public static void setServerAddress(final HttpServletRequest request) {
		serverAddress = request.getScheme() + "://" + request.getServerName()
				+ "/";
	}

}
